package com.cedric.yixianpai.game.interfaces;

import com.cedric.yixianpai.game.Constants.CardType;
import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Constants.Sect;
import com.cedric.yixianpai.game.Status.DuelStatus;

import java.io.Serializable;

public abstract class Card implements Serializable {
    private String title;
    private int level = 0;//卡牌等级1-3
    private Period period;//卡牌出现时期
    private Sect sect;//宗门
    private CardType cardType = CardType.NOTHING;//卡牌类型
    private boolean isSustained = false;//是否持续或者消耗牌
    private String description=null;

    private int damage = 0;//伤害
    private int count = 1;//伤害段数
    private int shield = 0;//护盾
    private int spiritNeed = 0;//需求灵气
    private int spiritAdd = 0;//添加灵气

    /**
     * 更自由的构造
     *
     * @param title 需要名字
     */
    public Card(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public Sect getSect() {
        return sect;
    }

    public void setSect(Sect sect) {
        this.sect = sect;
    }

    public int getDamage() {
        return damage;
    }

    public void setDamage(int damage) {
        this.damage = damage;
    }

    public int getCount() {
        return count;
    }

    public Card setCount(int count) {
        this.count = count;
        return this;
    }

    public int getShield() {
        return shield;
    }

    public void setShield(int shield) {
        this.shield = shield;
    }

    public Period getPeriod() {
        return period;
    }

    public void setPeriod(Period period) {
        this.period = period;
    }

    public int getSpiritNeed() {
        return spiritNeed;
    }

    public void setSpiritNeed(int spiritNeed) {
        this.spiritNeed = spiritNeed;
    }

    public int getSpiritAdd() {
        return spiritAdd;
    }

    public void setSpiritAdd(int spiritAdd) {
        this.spiritAdd = spiritAdd;
    }

    public CardType getCardType() {
        return cardType;
    }

    public void setCardType(CardType cardType) {
        this.cardType = cardType;
    }

    public abstract boolean effect(DuelStatus Sta1, DuelStatus Sta2);

    public boolean isSustained() {
        return isSustained;
    }

    public void setSustained() {
        isSustained = true;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
